home *** CD-ROM | disk | FTP | other *** search
- OGLE
- by Michael Day
- as of 4 September 1989
-
-
-
- There is a song that goes "I only have eyes for you dear."
- Ogle can be described that way. Ogle is in love with the mouse.
- In fact, Ogle is so much in love that it watches the mouse
- wherever it goes.
-
- I originally saw this running on a Sun workstation. I liked
- it so much I decided to write a version for the PC.
-
- Actually, the EYES unit that Ogle uses can be made to look
- at any point on the screen and not just the mouse. The procedure
- "LookAt" contains two parameters, "Mx" and "My". These are the
- X/Y location on the screen to look at.
-
-
-
- Creating the Eyes:
-
- procedure MakeEyes(var EyeData:EyeDataRec;
- Xp,Yp,Size,Style:integer; Eye,Edge,Pupil:byte);
-
- To create the Eyes, you will need to place a call to the
- "MakeEyes" procedure. MakeEyes expects eight parameters. The
- first parameter is a record variable called EyeData. EyeData does
- not need to be preinitialized to anything, the MakeEyes procedure
- will correctly configure the EyeData record based on the other
- four parameters that are passed. The EyeData variable can be a
- global variable, or one that is created on the heap.
-
- The Xp/Yp parameters specify the screen position to place
- the eyes. The Xp/Yp coordinate specified is the center of the
- left eye. The Size parameter passed is the X radius of the eye
- ellipse. All other parameters for the eye are derived from this.
- The Y radius is predefined as being twice the size of the X
- radius passed. The right eye is simply a copy of the left eye
- offset to the right by an X radius factor of three. The Y radius
- is corrected for the proper aspect ratio on the screen.
-
- The Style parameter specifies the type of eye movement to
- use. A value of one will cause the eye movement to be directly
- scaled down from the screen. The screen is divided into four
- quadrants around the center of each eye. If the mouse resides in
- one of the screen quadrants, the mouse position is scaled down to
- fit with the appropriate eye quadrant in a similar position.
-
- If the Style parameter passed is two, then the scaled eye
- movement will be modified with a log2 conversion. This causes the
- eye movement to be more sensitive as the mouse comes near the
- eye center position.
-
- If the Style parameter passed is anything other than one or
- two, the eye movement will be limited. That is, as long as the
- mouse X or Y parameter resides within the eye boundry the pupil
- will follow the mouse. When the mouse parameter exceeds the eye
- movement boundry it will become limited to the edge of the eye
- boundry for that parameter.
-
- The Eye, Edge, and Pupil parameters control the eye colors
- used. "Eye" sets the eye background color. "Edge" sets the edge
- color of the eye, and "Pupil" sets the Pupil color of the eye.
-
-
- Pointing the eyes:
-
- procedure LookAt(var EyeData:EyeDataRec; Xp,Yp:integer);
-
- You can point the eyes at any screen location by calling the
- LookAt procedure. Three parameters are passed. The forst is
- the variable parameter EyeData which points to the EyeData that
- was configured by MakeEyes. You must call the MakeEyes procedure
- at least once to set up the EyeData before calling LookAt.
- Failure to do so will most likely cause a program crash.
-
- All the data needed by the LookAt procedure is contained
- within the EyeData record. This allows you to place multiple eyes
- on the screen by setting up multiple EyeData records. The
- MakeEyes procedure only affects the EyeData record passed to it.
- The Ogle demo program provided shows an example of multiple eyes
- on the display.
-
- The position of the screen that you want the Eyes to look at
- is passed in the Xp,Yp parameters.
-
- You can change the eye movement style, or the eye colors, or
- the position of the eyes on the screen at anytime by simply
- calling the MakeEye procedure again at anytime. It is up to you
- to remove the old eyes from the screen first if you will be
- changing their position.
-
- <eof>
-